import request from "@/util/api.js"


/**
 * 获取店铺优惠券
 * @param {Object} mer_id
 * @param {Object} data
 */
export function getMerchantCoupon(mer_id, data) {
	return request.get(`coupon/store/${mer_id}`, data)
}


/**
 * 获取用户拥有优惠券列表
 * @param {*} data 
 */
export function getUserCouponListApi(data) {
	return request.get('coupon/list', data)
}


/**
 * 菜市场下优惠券列表
 * @param {Object} mar_id
 * @param {Object} data
 */
export function getCouponListApi(mar_id, data) {
	return request.get(`coupon/marCouponList/${mar_id}`, data)
}

/**
 * 领取优惠券
 * @param {*} data 
 */
export function receiveCouponApi(data){
	return request.post(`coupon/receive/${data.coupon_id}`)
}